package it.tukano.swingdeco;

import javax.swing.ImageIcon;

/**
 * Image icon utilities.
 * @author pgi
 */
public class ImageIconExt extends ImageIcon {

    /* Serial version of this class */
    private static final long serialVersionUID = 0;

    /**
     * Instance initializer
     */
    public ImageIconExt(String iconResource) {
        super(ImageIconExt.class.getResource(iconResource));
    }

    /**
     * Initializes this icon
     * @param packageName the name of the package (ie it.tukano.swingdeco)
     * @param imageFile the name of the icon file (ie folder.png)
     */
    public ImageIconExt(String packageName, String imageFile) {
        super(ImageIconExt.class.getResource("/" + packageName.replace(".", "/") + "/" + imageFile));
    }
}
